﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Canyala.Lagoon.Models
{
    public class PositionRange
    {
        public readonly long From;
        public readonly long To;

        internal PositionRange(long from, long to)
        {
            From = from;
            To = to;
        }

        public long Count 
            { get { return To - From + 1; } }

        public static PositionRange Create(long from, long to)
            { return new PositionRange(from, to); }

        public static PositionRange FromPositionAndCount(long position, long count)
            { return new PositionRange(position, position + count); }
    }
}
